<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    queryURLParams 问号参数处理
    <script>
         /* 
            var  str ="https://www.baidu.com?name=zhufeng&age=10&id=14";
            {
                name:"zhufeng",
                age:10,
                id:14
            }
       */
       
        var straa ="https://www.baidu.com?name=zhufeng&age=10&id=14";

        function show(str){
            var strRight=str.split("?")[1];//"name=zhufeng&age=10&id=14"
            var arr=strRight.split("&");//['name=zhufeng', 'age=10', 'id=14']
        
            var obj={};
            for(var i=0;i<arr.length;i++){
                var smallArr=arr[i].split("=");
                //['name','zhufeng']['age','10']['id','14']
                obj[smallArr[0]]=smallArr[1];
            }
            return obj;
        }
        var resobj=show(straa);//直接将值给传递过去
        console.log(resobj);
        
    </script>
</body>
</html>